package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.BillingMapper;
import com.ruoyi.shop.domain.Billing;
import com.ruoyi.shop.service.IBillingService;

/**
 * 商家对账Service业务层处理
 *

 * @date 2023-07-24
 */
@Service
public class BillingServiceImpl implements IBillingService
{
    @Autowired
    private BillingMapper billingMapper;

    /**
     * 查询商家对账
     *
     * @param billingId 商家对账主键
     * @return 商家对账
     */
    @Override
    public Billing selectBillingByBillingId(Long billingId)
    {
        return billingMapper.selectBillingByBillingId(billingId);
    }

    /**
     * 查询商家对账列表
     *
     * @param billing 商家对账
     * @return 商家对账
     */
    @Override
    public List<Billing> selectBillingList(Billing billing)
    {
        return billingMapper.selectBillingList(billing);
    }

    /**
     * 新增商家对账
     *
     * @param billing 商家对账
     * @return 结果
     */
    @Override
    public int insertBilling(Billing billing)
    {
        billing.setCreateTime(DateUtils.getNowDate());
        return billingMapper.insertBilling(billing);
    }

    /**
     * 修改商家对账
     *
     * @param billing 商家对账
     * @return 结果
     */
    @Override
    public int updateBilling(Billing billing)
    {
        return billingMapper.updateBilling(billing);
    }

    /**
     * 批量删除商家对账
     *
     * @param billingIds 需要删除的商家对账主键
     * @return 结果
     */
    @Override
    public int deleteBillingByBillingIds(Long[] billingIds)
    {
        return billingMapper.deleteBillingByBillingIds(billingIds);
    }

    /**
     * 删除商家对账信息
     *
     * @param billingId 商家对账主键
     * @return 结果
     */
    @Override
    public int deleteBillingByBillingId(Long billingId)
    {
        return billingMapper.deleteBillingByBillingId(billingId);
    }
}
